import java.util.Arrays;

/**
 * Created with IntelliJ IDEA.
 * Description:最长上升子序列(一)
 * User: wangxin
 * Date: 2025-02-07
 * Time: 21:00
 */
public class Test {
    public int LIS (int[] a) {
        // write code here
        if(a == null||a.length == 0){
            return 0;
        }
        int[] dp = new int[a.length];
        Arrays.fill(dp,1);
        int res = 1;
        for(int i = 1;i < a.length;i++){
            for(int j = 0;j < i;j++){
                if(a[i] > a[j]&&dp[i] < dp[j]+1){
                    dp[i] = dp[j]+1;
                    res = Math.max(res,dp[i]);
                }
            }
        }

        return res;
    }
}
